<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="Public/Home/css/index.css"/>
		<link rel="stylesheet" type="text/css" href="Public/Home/css/car_2.css"/>
		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<!-- 后盾js的引入 -->
		<link rel="stylesheet" href="Public/Home/Common/hdjs/hdjs.css">
		<script src="Public/Home/Common/hdjs/hdjs.min.js"></script>

		
		<!-- <script src="Public/Home/js/jquery.easydrag.handler.beta2.js" type="text/javascript" charset="utf-8"></script> -->
		<script src="Public/Home/js/car.js" type="text/javascript" charset="utf-8"></script>
		<script src="Public/Home/js/area.js" type="text/javascript" charset="utf-8"></script>

		<title>购物车第二部</title>
		<style>

			#car_title {
			  width: 1200px;
			  height: 118px;
			  margin: auto;
			}
			#car_title .new_logo {
			  width: 223px;
			  height: 32px;
			  margin-top: 43px;
			  background: url(Public/Home/images/logo.jpg) no-repeat;
			}
			#car_title .new_logo ul {
			  width: 574px;
			  height: 34px;
			  list-style: none;
			  margin-left: 624px;
			  background: url(Public/Home/images/gwcTwo.jpg) no-repeat;
			}

			.overLay {
	            position: fixed;/*这里的定位方式使用fixed能保证遮罩层百分百的覆盖整个窗口*/
	            width: 100%;
	            height: 100%;
	            top: 0;
	            left: 0;
	            bottom:0;
	            opacity: 0.5;
	            background-color: #000000;
	            z-index: 66666;
      		}

		 .alertContent {
            width: 200px;
            height: 200px;
            background: #ffffff;
            position: absolute;
            top: 150px;
            left: 350px;
            z-index: 999999;
            color: #808080;
        }
        .alertContent li{
        	margin-top: 20px;
        }


						
		</style>
		<script type="text/javascript">
		$(function(){
			//初始化方法
			area.init('a');

		
			//修改的时候默认被选中效果
			// area.selected('黑龙江','哈尔滨','道里区');
		})
	</script>

	</head>
	<body  >
	
	<!--填写地址的悬浮框的使用 -->
	<div class="overLay" style="display:none"></div>
	<div class="alertContent" style="width: 700px;height: 497px; display:none">
		    	<form action="javascript:;" method="post" id="userBtn">
		    		<span class="closexf" style="font-size:40px;position:absolute;right:20px;">&otimes;</span>
			       	<center><h3 style="margin:10px;color:#808080;font-size:20px">添加地址</h3></center>

			       	<li >
			    	   	<span style="margin-left:50px;font-size:18px;">收货人:</span><input type="text" name="sendName" id="sendName" value="" style="height:30px;width:350px;margin-left:20px" />
			       	</li>
			     	<li >
			      	  	<span class="same" style="margin-left:50px;font-size:18px;">收货地址:</span>
			      	  	<span style="" >
			      		  	<select name="a1" id="a1" style="margin-left: 17px;width:100px;height:25px"></select>
					  		<select name="a2" id="a2" style="margin-left: 17px;width:100px;height:25px"></select>
							<select name="a3" id="a3" style="margin-left: 17px;width:100px;height:25px"></select>
					 	</span>
						<center><textarea  style="width:550px;height:100px;margin-top:20px;padding:10px"  placeholder="详细信息"  id="address_desc" rows="" cols=""></textarea></center>
			      	</li>
			    	<li ">
			    		<span style="margin-left:50px;font-size:18px;">手机号码:</span>
			    		<input type="text" name="telphone" id="telephone" value="" style="margin-left: 20px;width: 250px;height: 30px;"/>
			    	</li>
			    	<li style="width: 380px;height: 40px;position: absolute;top: 358px;margin: auto;left: 23%;" id="btnn">
			    		<a href="javascript:;" style="width: 180px;height: 40px;text-align: center;line-height: 40px;border: 1px solid #BBBBBB;display: block;float: left;font-size: 15px;" id="okSendAddress">确定</a>
			    		<a href="javascript:;" style="width: 180px;height: 40px;line-height: 40px;border: 1px solid #BBBBBB;display: block;float: left;text-align: center;margin-left: 10px;font-size: 15px;" class="closeRL">取消</a>
			    	</li>
			    </form>
		    </div>
		<!-- 悬浮框结束 -->
			<script type="text/javascript">
		
				$(function(){

					// 模态框中应用的函数
					$(document).scroll(function(){
						var top=$(this).scrollTop();
						// oldTop=$('.alertContent').offset().top;
						var newTop=top+150;
						oldTop=$('.alertContent').css('top',newTop+'px');
					})

					$('.new_address').click(function(){
						var len=$('.address_custorm').length;
						if(len>0){
							return;
						}
						$('.overLay').show();
						$('.alertContent').show();
					})
					$('.closexf').click(function(){
						$('.overLay').hide();
						$('.alertContent').hide();
					})
					$('.closeRL').click(function(){
						$('.overLay').hide();
						$('.alertContent').hide();
					})
					// 提交添加的地址内容
					$('#okSendAddress').click(function(){
						var name=$('#sendName').val();
						var a1=$('#a1').val();
						var a2=$('#a2').val();
						var a3=$('#a3').val();
						var a4=$('#address_desc').val();
						var telephone=$('#telephone').val();
						var str='';
						str+='<div class="address_custorm"><ul><li class="common_li">';
						str+='<div class="qi_zhi common"></div><span class="send_address">寄送至</span>';
						str+='<input type="radio" name="tag" class="chose_address" value="" checked="checked"/>';
						str+='<span class="login_name"></span>';
						str+='<span class="address">'+a1+a2+a3+a4+'</span>';
						str+='<span class="name">收货人：'+name+'</span>';
						str+='<span class="tel">电话：'+telephone+'</span>';
						str+='<span class="address_change"></span>';						
						str+='<span class="del delPs" style="">×</span></li></ul></div>';
						$('#address').append(str);

						$('.overLay').hide();
						$('.alertContent').hide();
					})


					// 添加未来事件，给新添加的元素,未来事件在其内部就不需要再添加未来事件了
					$(document).on('click','.del.delPs',function(){
						$('.address_custorm').remove();
					})



					// 提交订单中函数
					var gwcData={{json_encode($gwcData)}};
					var gwcMidData={{json_encode($gwcMidData)}};
					$('#tjdd').click(function(){
						// 判断对象是否存在，这种判断方法是jquery的判断方法
						var len=$('.address_custorm').length;
						if(len>0){
							var name=$('#sendName').val();
							var a1=$('#a1').val();
							var a2=$('#a2').val();
							var a3=$('#a3').val();
							var a4=$('#address_desc').val();
							var str=a1+'|'+a2+'|'+a3+'|'+a4;
							var telephone=$('#telephone').val();
							$.ajax({
							  type: "post",
							  url: "{{U('Gwc/carTwoAjax')}}",
							  data:{name,str,telephone,gwcData,gwcMidData},
							  dataType: "json",
							  success:function(phpData){
							  	
							  	location.href="{{U('Gwc/carThree')}}"+"&oid="+phpData;
							  }
							});



						}else{
							hd_alert({message:'请先添加收货人地址'});
						}
					})
	
				})	
			</script>


		<!--头部开始-->
		<!--头部公共头部-->
		<div id="top">
			<div class="mid">
				<div class="left">
					<a href="{{U('Index/index')}}" class="huaWe">大雷官网</a>
				
					<div class="softUser">	
					</div>
				</div>
				<div class="right">
					<div class="webNav">
					
					</div>
					<a href="javascript:;">{{$userData['username']}}</a>
					<a href="{{U('Login/out')}}">退出</a>
					<a href="{{U('Person/index')}}">我的订单</a>

				</div>
			</div>
		</div>
		<!--公共头部结束-->	
		<!--头部结束-->


			<!--标题部分-->
		<div id="car_title">
			<div class="new_logo">
				<ul>
	
				</ul>
			</div>
		</div>
		<!--标题部分结束-->

		<!--收货地址-->
		<div id="address" style="margin-top: 20px;">
			<div class="address_color"></div>
			<span class="user_address">收货人信息</span>
			<span class="new_address">[添加收货人地址]</span>
			<!-- <div class="address_custorm">
				<ul>
					<li class="common_li">
						<div class="qi_zhi common">
						</div>
						<span class="send_address">寄送至</span>	
						<input type="radio" name="tag" class="chose_address" value="" checked="checked" />
						<span class="login_name">ruanlianjun</span>
						<span class="address">海南白沙牙叉镇 wsefdwe</span>
						<span class="name">收货人：ruanjun</span>
						<span class="tel">电话：18010855386</span>
						<span class="address_change">修改</span>
						<span class="del">×</span>
					</li>
				
				</ul>
			</div> -->
		</div>
		<!--收货地址结束-->
		<!--发票信息-->
		<div id="cover">
			<div id="paper_message">
				<div class="goods_message">
					以下商品由  <span>华为商城</span>  选择合作快递配送
				</div>
				
				<div class="goods">
					<li>商品</li>
					<li>单价（元）</li>
					<li>数量</li>
					<li>小计（元）</li>
				</div>
				{{foreach  from="$gwcData['goods']" key="$k"  value="$v"}}	
					<div class="goods">
						<li>{{$v['name']}}  {{foreach from="$gwcMidData[$k]['goods_attr']" value="$vv"}}
													&prop;{{$vv}}
													{{endforeach}}
						</li>
						<li>¥{{floor($v['price'])}}.00 </li>
						<li>{{$v['num']}}	</li>
						<li>¥{{$v['total']}}.00</li>
					</div>
				{{endforeach}}		
				
					<div class="all_message">
						<li>
							<span>商品总金额：</span>
							<span>¥</span>
							<span>{{$gwcData['total']}}.00</span>
						</li>
						<li>
							<span>运费：</span>
							<span>¥</span>
							<span>0.00</span>
						</li>
						<li>
							<b>¥</b>
							<b> 应付金额：</b>
							<b style="font-size:20px">{{$gwcData['total']}}.00</b>
						</li>
					</div>
				
				</div>
			</div>
		<!--发票信息结束-->
		<!--提交-->
		<ul id="send_you" style="margin-bottom: 30px;">
			<li>应付总额: &nbsp;</li>
			<li  style="font-size:20px">¥{{$gwcData['total']}}.00</li>
			<a href="javascript:;" id="tjdd">提交订单</a>
		</ul>
		<!--提交结束-->
		<!--公共 的底部-->
		
		<div id="xian">
				
		</div>
		<div id="aboutWe">
			<p>
				<i class="iconfont">&#xe600;</i>
				<span>500强企业 品质保证</span>
			</p>
			<p>
				<i class="iconfont">&#xe691;</i>
				<span>7天退货 15天换货</span>
			</p>
			<p>
				<i class="iconfont">&#xf0082;</i>
				<span>99元起免运费</span>
			</p>
			<p>
				<i class="iconfont">&#xe62a;</i>
				<span>448家维修网点 全国联保</span>
			</p>
		</div>
		<!--微信qq微博手机客户端结束-->
		<!--站点公告-->
		<div id="webSet">
			<span>Copyright © 2012-2016 *******.COM 版权所有 保留一切权利</span>
			<div class="webOne">
				<ul>
					<li>******* 32011402010009号</li>
					<li>******09062682号-9</li>
					<li>*******务经营许可证：苏B2-20130048</li>
					<li>******经营许可证：苏网文[2012]0401-019号</li>
				</ul>
				
			</div>
		</div>
		<!--站点公告结束-->
		<div id="lastImg">
			<!-- <img src="Public/Home/images/b1.png" alt="" />
			<img src="Public/Home/images/d.png" alt="" />
			<img src="Public/Home/images/到.png" alt="" /> -->
		</div>
		
		
		<!--公共的底部结束-->
		
		
		
	</body>
</html>























